home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / falclib2.lzh / ROUTS / TRIG.S < prev    next >
Text File  |  1994-08-11  |  722b  |  40 lines

  1. *
  2. * TRIG.S
  3. *
  4. *    @sin
  5. *     Returns the sine of an angle.
  6. * In     d0.w=angle in degrees with six decimal bits (0-23039)
  7. * Out     d1.w=sin(angle), a word with one sign bit and 15 decimal bits.
  8. *     (destroys d0/a0)
  9. *
  10. *    @cos
  11. *     Returns the cosine of an angle.
  12. * In     d0.w=angle in degrees with six decimal bits (0-23039)
  13. * Out     d1.w=sin(angle), a word with one sign bit and 15 decimal bits.
  14. *     (destroys d0/a0)
  15. *
  16.  
  17.  
  18. @cos    move.l    #sintab,a0
  19.     lsr    #4,d0
  20.     cmp    #270*4,d0
  21.     blt    .add90
  22.     sub    #270*4,d0
  23.     bra    .done
  24. .add90    add    #90*4,d0
  25. .done    lsl    #1,d0
  26.     move    0(a0,d0.w),d1
  27.     rts
  28.  
  29.  
  30. @sin    move.l    #sintab,a0
  31.     lsr    #4,d0
  32.     lsl    #1,d0
  33.     move    0(a0,d0.w),d1
  34.     rts
  35.  
  36.  
  37. sintab    incbin    sintab.inl        A 1440 entries large sine table
  38.  
  39.  
  40.